<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="Admin">
    <meta name="_xsrf" content="{{.xsrf_token}}"/>
    <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
    <script src="https://cdn.bootcss.com/jquery-cookie/1.4.1/jquery.cookie.js"></script>
    <script src="/static/js/jquery.base64.js"></script>
    <script src="https://cdn.bootcss.com/js-xss/0.3.3/xss.min.js"></script>
    <title>新建文章</title>

    <link rel="shortcut icon"
          href=""
          type="image/x-icon"/>
    <link rel="stylesheet" href="https://unpkg.com/purecss@1.0.0/build/pure-min.css" integrity="sha384-"
          crossorigin="anonymous">
    <link rel="stylesheet" href="/static/css/layouts/btnstyle.css">


    <!--[if lte IE 8]>
    <link rel="stylesheet" href="/static/css/layouts/old-ie.css">
    <![endif]-->
    <!--[if gt IE 8]><!-->
    <link rel="stylesheet" href="/static/css/layouts/email.css">
    <!--<![endif]-->
</head>
<body>

        <div class="content">
            <form id="P_form" method="post" action="">
                {{ .xsrfdata }}
                <div class="content-header pure-g">
                    <div class="pure-u-1-2">
                        <h3 class="content-title">标题：<input id="P_title" name="Title" type="text"
                                                            value=""></h3>
                        文章分类：<input id="P_category" name="Category" type="text" value="">
                    </div>
                    <div class="content-controls pure-u-1-2">
                        <button type="submit" class="secondary-button pure-button" id="but_save" onclick="updatepost()">
                            发布
                        </button>
                        <div class="switch-box is-primary">
                            <input id="primary" name="Top" class="switch-box-input" type="checkbox" checked/>
                            <input id="content" name="Content" type="hidden" value=""/>
                            <input id="morecontent" name="Morecontent" type="hidden" value=""/>
                            <label for="primary" class="switch-box-slider"></label>
                            <label for="primary" class="switch-box-label">置顶</label>
                        </div>
                    </div>
                </div>
            </form>
            <div id="editor" class="content-body"></div>
        </div>

<script type="text/javascript" src="//unpkg.com/wangeditor/release/wangEditor.min.js"></script>
<script type="application/javascript">
    // ;eval(function(p,a,c,k,e,r){e=function(c){return c.toString(a)};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('1 2=5.6;1 0=7 2(\'#0\');0.3.8=4;0.3.9=a;0.b();c d(){$("#e").f(0.g.h());i 4}',19,19,'editor|var|E|customConfig|true|window|wangEditor|new|uploadImgShowBase64|pasteFilterStyle|false|create|function|updatepost|content|val|txt|html|return'.split('|'),0,{}));
    var E = window.wangEditor;
    var editor = new E('#editor');
    editor.customConfig.uploadImgShowBase64 = true;   // 使用 base64 保存图片
    editor.customConfig.pasteFilterStyle = false;
    editor.create();
    function updatepost() {
        var content = editor.txt.html();
        var morecontent = editor.txt.text().substr(0,100);
        $("#content").val(content);
        $("#morecontent").val(morecontent);
        return true;
    }
</script>

</body>
</html>